package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.DiZhouPlayBean;
import com.genesis.yunnanji.bean.PavilionBean;
import com.genesis.yunnanji.config.GenesisApiConfig;
import com.genesis.yunnanji.view.GlideRoundTransform;

import java.util.List;

/**
 * 体验馆详情评论
 */

public class DiZhouPlayAdapter extends BaseQuickAdapter<DiZhouPlayBean, BaseViewHolder> {
    private Context context;

    public DiZhouPlayAdapter(Context context, @Nullable List<DiZhouPlayBean> data) {
        super(R.layout.item_di_zhou_play_img, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, DiZhouPlayBean item) {

//        BitmapUtils bitmapUtils = new BitmapUtils(context);
//        bitmapUtils.display((ImageView) helper.getView(R.id.iv_img), GenesisApiConfig.PIC_HOST + item.getApp_img());
        RequestOptions options = new RequestOptions()
                .centerCrop()
                .transform(new GlideRoundTransform(context, 30));
        Glide.with(mContext).load(item.getImgResource())
//                .apply(options)
                .into((ImageView) helper.getView(R.id.iv_img));
        helper.setText(R.id.tv_name, item.getText());


    }
}
